package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.HRServicedtp;
import com.zr.serviceImpl.HRServiceImpldtp;
//删除员工
public class DeleteEmplsControllerdtp extends HttpServlet{
	HRServicedtp hr=new HRServiceImpldtp();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String[] dels=req.getParameterValues("dels");
		boolean flag=false;
		for(int i=0;i<dels.length;i++){
			flag=hr.delEmpl(Integer.parseInt(dels[i]));		
		}
		PrintWriter pw=resp.getWriter();
		if(flag==true){
			pw.write("true");
		}else{
			pw.write("false");
		}
		
	}
}
